package partner_admin

import (
	"gitee.com/theegg/go-brick/app/modules/partner_api/partner_admin/partner_admin_api"
	"github.com/gin-gonic/gin"
)

// 登录
func InitPartnerAdminAuthRoute(routerGroup *gin.RouterGroup) {
	routerGroup.POST("/auth/login", partner_admin_api.Login)
	routerGroup.POST("/auth/logout", partner_admin_api.Logout)
}

// 管理
func InitPartnerAdminRoute(routerGroup *gin.RouterGroup) {
	routerGroup.GET("/admin/baseInfo", partner_admin_api.BaseInfo)

	// 租户 - 管理员
	routerGroup.POST("/admin/user/list", partner_admin_api.AdminUserList)
	routerGroup.POST("/admin/user/add", partner_admin_api.AdminUserAdd)
	routerGroup.POST("/admin/user/setting", partner_admin_api.AdminUserSetting)
	routerGroup.POST("/admin/user/del", partner_admin_api.AdminUserDel)
	routerGroup.POST("/admin/user/state", partner_admin_api.AdminUserState)
	routerGroup.POST("/admin/user/uploadAvatar", partner_admin_api.AdminUserAvatarUpload)
	routerGroup.POST("/admin/user/permission/get", partner_admin_api.AdminUserGetPermissions)
	routerGroup.POST("/admin/user/permission/edit", partner_admin_api.AdminUserEditPermissions)

	// 租户 - 角色
	routerGroup.GET("/admin/role/list", partner_admin_api.PartnerAdminRoleList)
	routerGroup.POST("/admin/role/status", partner_admin_api.PartnerAdminRoleStatus)
	routerGroup.POST("/admin/role/add", partner_admin_api.PartnerAdminRoleAdd)
	routerGroup.POST("/admin/role/edit", partner_admin_api.PartnerAdminRoleEdit)

	// 租户 - 角色 分配权限
	routerGroup.POST("/admin/role/permission/get", partner_admin_api.PartnerAdminRoleGetPermissions)
	routerGroup.POST("/admin/role/permission/edit", partner_admin_api.PartnerAdminRoleEditPermissions)
	routerGroup.POST("/admin/role/menu/get", partner_admin_api.PartnerAdminRoleGetMenus)
	routerGroup.POST("/admin/role/menu/edit", partner_admin_api.PartnerAdminRoleEditMenus)

	// 租户 - 菜单
	routerGroup.POST("/admin/menu/list", partner_admin_api.AdminMenuList)
	routerGroup.POST("/admin/menu/detail", partner_admin_api.AdminMenuDetail)
	routerGroup.POST("/admin/menu/add", partner_admin_api.AdminMenuAdd)
	routerGroup.POST("/admin/menu/edit", partner_admin_api.AdminMenuAdd)
	routerGroup.POST("/admin/menu/del", partner_admin_api.AdminMenuDel)

	// 租户 - 权限
	routerGroup.POST("/admin/permission/list", partner_admin_api.AdminPermissionList)
	routerGroup.POST("/admin/permission/detail", partner_admin_api.AdminPermissionDetail)
	routerGroup.POST("/admin/permission/add", partner_admin_api.AdminPermissionAdd)
	routerGroup.POST("/admin/permission/edit", partner_admin_api.AdminPermissionAdd)
	routerGroup.POST("/admin/permission/del", partner_admin_api.AdminPermissionDel)

	// 租户 - 管理员　 日志
	routerGroup.POST("/admin/log/list", partner_admin_api.AdminLogList)
	routerGroup.POST("/admin/log/detail", partner_admin_api.AdminLogDetail)
}
